package com.waypolice.common.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: zyp
 * @Description:
 * @Date: Created in 13:54 2018/5/8
 */
public class PageUtils<Record> {

    public List<Record> pageList(List<Record> list, int offset, int limit){
        List<Record> finalList = new ArrayList<Record>();
        int groupNum =limit+offset;
        if(groupNum<=list.size()){
            for (int i=offset;i<limit+offset;){
                finalList.add(list.get(i));
                i++;
            }
        }else{
            for (int i=offset;i<list.size();i++){
                finalList.add(list.get(i));
            }
        }
        return finalList;
    }
}